package com.dongdongshop.pojo;

import com.dongdongshop.em.ConstantEnum;

public class StatusCode<T> {
    private Integer code;
    private String codename;
    private T t;

    public static StatusCode build(ConstantEnum e){
        StatusCode statusCode = new StatusCode();
        statusCode.setCode(e.getCode());
        statusCode.setCodename(e.getMessage());
        return statusCode;
    }

    public StatusCode(Integer code, String codename) {
        this.code = code;
        this.codename = codename;
    }

    public StatusCode() {
    }

    public StatusCode(Integer code, String codename, T t) {
        this.code = code;
        this.codename = codename;
        this.t = t;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getCodename() {
        return codename;
    }

    public void setCodename(String codename) {
        this.codename = codename;
    }

    public T getT() {
        return t;
    }

    public StatusCode setT(T t) {
        this.t = t;
        return this;
    }
}
